A PowerReplace Expression (PRExpression) is a text line containing two strings: first-string and second-string, enclosed by quotation marks and separated by space or tabulation. It means that the first-string will be replaced by the second-string everywhere in a text file. For example, the PRExpression
"print" "write"
means replace the word “print” by “write”.
The first-string, if necessary, may contain one special character * in the middle for any indeterminate string. The following PRExpression
"%*\n" ""
means delete all characters of a line beginning with % (delete Tex comment).
A Filter File is a text file containing many PRExpressions after being made through the menu “PowerReplace/File/Make Filter File”.
See also the documentation “FAQ” to understand better how to write PRExpression.
See “Version 4.5 readme” for new PRExpression format and some examples.
Create New Filter File:
(1) Create a text file using any text editor. Put your own PRExpressions in this file.
(2) Select the menu “File/Make Filter File”. The “Make PowerReplace Filter File” window appears.
(3) Click the button “Choose File”, and select the file that you have created at (1). The name of the text file will appear.
(4) Set option boxes in this window.
- If the “Extension Name” is empty, you must set the “Delete original file” option on.
- If the first-string in all PRExpressions is only one character, you can set the “Char Convert Only” option on. It will accelerate converting speed.
- Use Balloons Help system for more information.
(5) Click the button “Make” to turn this file into filter file. A progress indicator window appears during a short moment.
- If you want to create other filter file, repeat (1)-(5).
(6) Put the new created filter file into the “Filter” folder.
(7) Restart the application. This filter file will appear in the menu “Filter” and you can select it for your conversion.
See also the documentation “for beginners” to learn step by step from a complete example.
Filter File Format:
To make a text file into filter, PowerReplace adds some resource into it, then changes its creator. That's all. Filter file is still a text file, and you can modify it using any text editor, too!
Syntax Summary: (see also “Version 4.5 readme”)
Filter File:
Filter File-Text after being made through the menu “PowerReplace/File/Make Filter File”
Filter File-Text:
line... (... means repeat many time)
line:
PRExpression or
comment
comment:
%string-without-cr\r
PRExpression:
"first-string" "second-string"\r or
$hex-string1$ "second-string"\r or
"first-string" $hex-string2$ \r or
$hex-string1$ $hex-string2$" \r or
'pattern' "second-string"\r or
'pattern' $hex-string2$ \r
% Sorry, no definition for hex-string1, hex-string1, pattern.
% Any way, there is a small description for pattern in the
% "Version 4.5 readme" file.
first-string:
string or
string*string
second-string:
string
string:
char...
char:
normal-char or
special-char
char-without-cr:
normal-char or
special-char (excepte \r)
string-without-cr:
char-without-cr...
normal-char:
printable character (except the three following " \ *)